#!/usr/bin/env python3
# -*- coding:utf-8 -*-

# https://blog.csdn.net/zaq0123/article/details/78573186
# 利用Python的turtle库绘制玫瑰

import turtle


def rose():
    printer = turtle.Turtle()
    # 设置初始位置
    printer.penup()
    printer.left(90)
    printer.fd(200)
    printer.pendown()
    printer.right(90)

    # 花蕊
    printer.fillcolor("red")
    printer.begin_fill()
    printer.circle(10, 180)
    printer.circle(25, 110)
    printer.left(50)
    printer.circle(60, 45)
    printer.circle(20, 170)
    printer.right(24)
    printer.fd(30)
    printer.left(10)
    printer.circle(30, 110)
    printer.fd(20)
    printer.left(40)
    printer.circle(90, 70)
    printer.circle(30, 150)
    printer.right(30)
    printer.fd(15)
    printer.circle(80, 90)
    printer.left(15)
    printer.fd(45)
    printer.right(165)
    printer.fd(20)
    printer.left(155)
    printer.circle(150, 80)
    printer.left(50)
    printer.circle(150, 90)
    printer.end_fill()

    # 花瓣1
    printer.left(150)
    printer.circle(-90, 70)
    printer.left(20)
    printer.circle(75, 105)
    printer.setheading(60)
    printer.circle(80, 98)
    printer.circle(-90, 40)

    # 花瓣2
    printer.left(180)
    printer.circle(90, 40)
    printer.circle(-80, 98)
    printer.setheading(-83)

    # 叶子1
    printer.fd(30)
    printer.left(90)
    printer.fd(25)
    printer.left(45)
    printer.fillcolor("green")
    printer.begin_fill()
    printer.circle(-80, 90)
    printer.right(90)
    printer.circle(-80, 90)
    printer.end_fill()

    printer.right(135)
    printer.fd(60)
    printer.left(180)
    printer.fd(85)
    printer.left(90)
    printer.fd(80)

    # 叶子2
    printer.right(90)
    printer.right(45)
    printer.fillcolor("green")
    printer.begin_fill()
    printer.circle(80, 90)
    printer.left(90)
    printer.circle(80, 90)
    printer.end_fill()

    printer.left(135)
    printer.fd(60)
    printer.left(180)
    printer.fd(60)
    printer.right(90)
    printer.circle(200, 60)


def main():
    rose()


if __name__ == "__main__":
    main()
